
package com.catsic.zcjc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.catsic.base.BaseServiceImpl;
import com.catsic.base.exception.CatsicException;
import com.catsic.core.exception.CatsicExceptionCode;
import com.catsic.zcjc.constants.ZcjcConstants;
import com.catsic.zcjc.dao.ProvinceDao;
import com.catsic.zcjc.entity.Province;
import com.catsic.zcjc.service.ProvinceService;


@Service("provinceService")
public class ProvinceServiceImpl extends BaseServiceImpl<Province, Long> implements ProvinceService{
	
	/**
	 * ProvinceDao:省份Dao
	 */
	@Autowired
	private ProvinceDao provinceDao;
	
	

	@Override
	public Province findById(Long id){
		Province Province = getById(id);
		if(null == Province){
			throw new CatsicException(CatsicExceptionCode.实体不存在, ZcjcConstants.PROVINCE);
		}
		return Province;
	}
	

	
	@Override
	public List<Province> findAll() {
		return provinceDao.findAll();
	}
	
	
}
